MESSAGE("Setting RPATH of Qt platform plugin.")

set (scriptcmd ${CMAKE_CURRENT_LIST_DIR}/ChangeRPath.sh)

EXECUTE_PROCESS(COMMAND
		${scriptcmd}
	WORKING_DIRECTORY
		${CMAKE_INSTALL_PREFIX}
	RESULT_VARIABLE
		CMDRESULT
	OUTPUT_VARIABLE
		CMDOUT
)

#MESSAGE("Output ${CMDRESULT}: ${CMDOUT}")

IF (NOT "${CMDRESULT}" EQUAL "0")
	MESSAGE(SEND_ERROR "Setting of RPATH failed; exit code=${CMDRESULT}, output: ${CMDOUT}")
ENDIF()

